<?php session_start();
include "constants.php";

//To know login information
if ((isset($_POST['useremail'])) && (strlen(trim($_POST['useremail'])) > 0)) {
	$CheckEmail = stripslashes(strip_tags($_POST['useremail']));
} else {$CheckEmail = '';}
if ((isset($_POST['userpwd'])) && (strlen(trim($_POST['userpwd'])) > 0)) {
	$_SESSION['UserPWD'] = md5(stripslashes(strip_tags($_POST['userpwd'])));
} else {$_SESSION['UserPWD'] = md5('');}


//$CheckEmail=$_POST['useremail'];
//$_SESSION['UserPWD']=md5($_POST['userpwd']);
$_SESSION['Username']=$_POST['useremail'];
$USERNAME=$CheckEmail;
$PASSWORD=md5(stripslashes(strip_tags($_POST['userpwd'])));

if(!isset($_SESSION['Username']))
{echo "Your username (email address) is not stored in our system, please start your ". "<a href='apply.php'>application here</a> now, thank you for your cooperation!";
exit();
}


$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); 

if (!$link) { 
    die('Could not connect: ' . mysql_error()); 
} 
mysql_select_db(DB_NAME);


//To pull out login information
$SQL="SELECT UserName,UserPWD,ProfileID FROM `MainTable` WHERE UserName = '$USERNAME' and UserPWD='$PASSWORD'";
$LoginID=mysql_query($SQL);
$rows = mysql_fetch_array($LoginID);
if (mysql_num_rows($LoginID)!= 1) { 
 echo "YOur username and password are not matched in our system, please re-apply again or start your application from the beginning "."<a href='apply.php'>"."Apply here Now</a>"; 
 include "member.php"; 
 exit();
} 
else { 
$_SESSION['IP'] = $_SERVER['REMOTE_ADDR']; 
$_SESSION['ProfileID'] = $rows['ProfileID'];
$PRSEC = $rows['ProfileID'];
}

//Validation

//To pull out personal information
//$link = mysql_connect('cash2uca.ipagemysql.com', 'cash2uca', 'actW3740!@#$'); 
//if (!$link) { 
//    die('Could not connect: ' . mysql_error()); 
//} 
//mysql_select_db(cash2uca); //46 lines

//Pull out coupon information
$sqlcoup = "SELECT Rate FROM `Promotion` WHERE PID= '1'";
$sqlcoupre=mysql_query($sqlcoup);
$rowcoup = mysql_fetch_array($sqlcoupre);
$temp=$rowcoup['Rate'];
$coup=sprintf("%1\$.2f",$temp);


$sqlP = "SELECT FirstName , LastName, Province,SIN FROM `Profiles` WHERE ProfileID= '".$_SESSION['ProfileID']."'";
$sqlpresult=mysql_query($sqlP);
$rowp = mysql_fetch_array($sqlpresult);
$_SESSION['firstname']=$rowp['FirstName'];
$_SESSION['lastname']=$rowp['LastName'];
$_SESSION['province']=$rowp['Province'];
$_SESSION['SIN']=$rowp['SIN'];

//To find the cost per 100 for applicant's residence

$sqlPROV = "SELECT Rates FROM `ProvinceRates` WHERE Province = '".$_SESSION['province']."'";
$PRate=mysql_query($sqlPROV);
$Prow=mysql_fetch_array($PRate);
$_SESSION['PRates']=$Prow['Rates']; 

//To determine number of visits//53 lines
$sqlvisits="SELECT COUNT(*) as Nums FROM `Applications` WHERE ProfileID='".$_SESSION['ProfileID']."'";
$sqlnums=mysql_query($sqlvisits);
$rownum = mysql_fetch_array($sqlnums);
if ($rownum['Nums']==0||empty($rownum['Nums'])) {
$_SESSION['novisits']=0;
$VISITS=1;
}
else {
$_SESSION['novisits']=$rownum['Nums'];
$VISITS=$rownum['Nums']+1;
}

//To determine the maixmum value 
if($_SESSION['novisits']==1)
{$values1="";
$values2="visibility:hidden";
$values3="visibility:hidden";
$values4="visibility:hidden";
$values5="visibility:hidden";
$values6="visibility:hidden";}

//TO retrieve banking information//60 lines
//$sqlbanking="SELECT BankName, DebitID, DebitPWD, SQ1, AS1, SQ2, AS2, SQ3, AS3, SQ4, AS4, SQ5, AS5,Employer, EAddress, ECity, EProvince, EPhone, EPost, DateHired, JobStatus,Occupation,PayType, PayFrequency, FirstPayDay, SecondPayDay, OtherIncome, MonthlyIncome, PayBy, TransitID, InstitutionID, CheckID FROM Applications WHERE ProfileID= '$PRSEC' ORDER BY AccountID DESC LIMIT 1";
$sqlbanking="SELECT * FROM Applications WHERE ProfileID= '$PRSEC' ORDER BY AccountID DESC LIMIT 1";
$sqlbankingresult=mysql_query($sqlbanking);
$rowbanking = mysql_fetch_array($sqlbankingresult);
$_SESSION['BankName']=$rowbanking['BankName'];
$_SESSION['DebitID']=$rowbanking['DebitID'];
$_SESSION['DebitPWD']=$rowbanking['DebitPWD'];
$_SESSION['SQ1']=$rowbanking['SQ1'];//70
$_SESSION['AS1']=$rowbanking['AS1'];
$_SESSION['SQ2']=$rowbanking['SQ2'];
$_SESSION['AS2']=$rowbanking['AS2'];
$_SESSION['SQ3']=$rowbanking['SQ3'];
$_SESSION['AS3']=$rowbanking['AS3'];
$_SESSION['SQ4']=$rowbanking['SQ4'];
$_SESSION['AS4']=$rowbanking['AS4'];
$_SESSION['SQ5']=$rowbanking['SQ5'];
$_SESSION['AS5']=$rowbanking['AS5'];
$_SESSION['Employer']=$rowbanking['Employer'];
$_SESSION['EAddress']=$rowbanking['EAddress'];
$_SESSION['ECity']=$rowbanking['ECity'];
$_SESSION['EProvince']=$rowbanking['EProvince'];
$_SESSION['EPhone']=$rowbanking['EPhone'];
$_SESSION['EPost']=$rowbanking['EPost'];//80
$_SESSION['DateHired']=$rowbanking['DateHired'];
$_SESSION['JobStatus']=$rowbanking['JobStatus'];
$_SESSION['Occupation']=$rowbanking['Occupation'];
$_SESSION['PayType']=$rowbanking['PayType'];
$_SESSION['PayFrequency']=$rowbanking['PayFrequency'];
$_SESSION['OtherIncome']=$rowbanking['OtherIncome'];
$_SESSION['MonthlyIncome']=$rowbanking['MonthlyIncome'];
$_SESSION['PayBy']=$rowbanking['PayBy'];
$_SESSION['TransitID']=$rowbanking['TransitID'];
$_SESSION['InstitutionID']=$rowbanking['InstitutionID'];
$_SESSION['CheckID']=$rowbanking['CheckID'];

$CREDITS=$rowbanking['Credits'];
$STATUS=$rowbanking['NewApp'];

if($VISITS<=1){$VISITS=1;}
if($CREDITS!=0)
{
	$VISITS=$CREDITS;
}
else if($CREDITS==0)
{
	$VISITS=$VISITS;
}


//To get maximum loan amount
$sql = "SELECT * FROM MAXIMUMLOANS WHERE CREDITS <='$VISITS' ORDER BY LOANAMOUNT DESC LIMIT 1";
$result=mysql_query($sql);
$rows=mysql_fetch_array($result);
$maxamount=$rows['LOANAMOUNT']; 

if($STATUS=="1") {
	echo "You submit your new payday loan application and we don't have the final decision yet, please come back later. Thanks for your cooperation!<br/><br/>";
	echo "<a href='index.html'>www.cash2u.ca</a>";
	session_destroy();
	exit();
} else if($STATUS=="7"||$STATUS=="3") {
	//To determine whether or not this application is the second application at the same time
	$SQLSecond="SELECT FirstPayDay,Datediff( NOW( ) , STR_TO_DATE(FirstPayDay, '%m/%d/%Y' ) ) AS SEC FROM `Applications` WHERE ProfileID ='$PRSEC'ORDER BY AccountID DESC Limit 0,1";
	$SECS=mysql_query($SQLSecond);
	$ROWS = mysql_fetch_array($SECS);
	$SECONDS=$ROWS['SEC'];
	$PayBack=$ROWS['FirstPayDay'];

	if ($SECONDS < 0) { 
		echo "Sorry, your scheduled loan repayment date is on ".$PayBack.". Please submit your payday loan application again after this date. We appreciate your business! Thanks!"; 
		echo "<a href='index.html'>www.cash2u.ca</a>";
		exit();
	} 

} else if($STATUS=="4") {
	echo "Due to NSF in your bank account, please re-submit after your NSF is clear. Thanks!<br/><br/>"; 
	echo "<a href='index.html'>www.cash2u.ca</a>";
	session_destroy();
	exit();	
} else if($STATUS=="8") {
	echo "We can't approve your loan applicaton due to your default loan payment. You have to repay your default loan first, 
		once it's clear, we will process your new loan application.
		Please arrange your default loan repayment. Thanks!<br/><br/>"; 
		echo "<a href='index.html'>www.cash2u.ca</a>";
		session_destroy();
		exit();
} else if($STATUS=="9") {
	echo "Sorry, we have sent your information to our collection agency, once your repayment is clear, 
		then we can process your new loan application. Thanks!<br/><br/>"; 
		echo "<a href='index.html'>www.cash2u.ca</a>";	
		session_destroy();
		exit();	
} else if($STATUS=="5") {
	//To determine whether or not this application is the second application at the same time
	$SQLSecond="SELECT FirstPayDay,Datediff( NOW( ) , STR_TO_DATE(FirstPayDay, '%m/%d/%Y' ) ) AS SEC FROM `Applications` WHERE ProfileID ='$PRSEC'ORDER BY AccountID DESC Limit 0,1";
	$SECS=mysql_query($SQLSecond);
	$ROWS = mysql_fetch_array($SECS);
	$SECONDS=$ROWS['SEC'];
	$PayBack=$ROWS['FirstPayDay'];

	if($SECONDS < 0){ 
		echo "We refused your last payday application. 
		please come back later after ".$PayBack." Thanks!<br/><br/>"; 
		echo "<a href='index.html'>www.cash2u.ca</a>";
		session_destroy();
		exit();	
	} 
}


//Determine the credits
$_SESSION['novisits']=$VISITS;

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Cash2u.ca: Payday loan online application for Canadians</title>
<META NAME="Keywords" CONTENT="How it works, payday loans,cash advance, payday loan, pay day loans, payday cash advance, online, unsecured loans, no fax payday loans, payday advance, payday cash loan, payday loans, cash advance, paycheque loans, short term,fast cash, unsecured personal loans, pay day loan, no fax loans, no faxing payday loans, no fax cash advance, faxless payday loans, short term loans, unsecured personal loan, unsecured loan, online loans, quick cash, no fax payday loan, payday cash advance, cash advance, online loan, fast cash loans, signature loan, no fax pay day loans, pay day advance, payday loans no faxing required, payday loan online, no faxing cash advance, payday loans no faxing, canada, money mart, money here, quick cash,check,cashing,easy,tax, bill,payment,currency,card,credit,Easy Cash Advances,Internet Payday loans, Payroll Advance, Payday Loan Services,Online Payday Advances, Online Payday Loan Provider, Pay Day">
<META NAME="Description" CONTENT=Cash2u.ca offers online payday loans and cash advance for Canadians">

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script src="/css/jquery.maskedinput.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="/css/main_style.css"/>
<link rel="stylesheet" type="text/css" href="/css/index.css"/>
<script type="text/javascript" src="validationjava.js"></script>
<script src="formavalidates.js" type="text/javascript"></script> 
<script type="text/javascript" src="./css/mathematics.js">
</script>
<script type="text/javascript" src="./css/Changes.js">
</script>

<style type="text/css">@import "/css/jquery.datepick.css";</style>
<script type="text/javascript" src="/css/jquery.datepick.js"></script>
<script type="text/javascript">
$(function() {
	$('#efdate').datepick({yearRange: '-1:+10'});
	$('#esdate').datepick({yearRange: '-1:+10'});
});
function showDate(date) {
	alert('The date chosen is ' + date);
}
</script>

</head>
<body onload="MakeLoans()">
<div id="maincontainer">

<div id="headsection">
<div id="headback">
<br/><br/><br/><h1><a style="color:white;" href="apply.php">Cash to you</a></h1><p id="headpara"><a style="color:white;" href="apply.php">Simple Easy Fast - Your payday loan</a></p>
</div>
</div>

<table cellspacing="4" cellpadding="1" border="0" style="margin:5px;height:50px;width:740px;background-color:#084c8d;border:1px solid #e5e5e5;color:white;font-size:110%;font-weight:bold;">
<tr><td width="20"></td>
<td width="90" align="center"><a class="headlink" href="index.html">HOME</a></td>
<td width="90" align="center"><!--a class="headlink" href="existingcustomer.php">APPLY</a--></td>
<td width="130" align="center"><!--a class="headlink" href="updatebanking.php"><span class="displace">BANKING</span></a--></td>
<td width="110" align="center"><!--a class="headlink" href="udpateprofile.php"><span class="displace">PROFILE</span></a--></td>
<!--td width="90" align="center"><!--a class="headlink" href="faqs.php"><span class="displace">FAQ's</span></a--></td>
<td width="90" align="center"><a class="headlink" href="logoutcustomer.php"><span class="displace">LOGOUT</span></a></td>
<td width="140"></td>
</tr>
</table>

<div id="content">
    	<div id="Apphead" class="Apphead" style="margin: 20px 0 0 5px;">
        	<h3>LOAN APPLICATION</h3>
		<p>Please check your information below and correct it if error found or your information has changed</p>      
    	</div>
        <!-- EOD of Application Head -->    
          
        <div id="TopSectionWrapper" class="PersonalInfo">
		<div id="NewCust" class="NewCust">Existing Customer Application<?php echo $STATUS;?></div>

	<!--Starting of Personal Information Section-->
	<div id="TitleInfo" class="TitleInfo"><h2>Your Banking Information</h2></div>
	<form name="eSecondProfiles" method="post" action="esubmitapplicationCopy.php">
	<table cellspacing="4" cellpadding="1" border="0" style="margin: 0 0 0 0;">
		<tr>
                <td width="140" align="right">First Name:</td>
                <td width="170"><input type="text" style="width: 150px;" readonly value="<?php echo $_SESSION['firstname'];?>" name="Efirstname"></td>
                <td width="230" align="right">Last Name:</td>
                <td width="160"><input type="text" style="width: 150px;" name="Elastname" readonly value="<?php echo $_SESSION['lastname'];?>"></td>
		</tr>
		
		<tr>
                <td width="140" align="right">Email Address:</td>
                <td width="170"><input type="text" name="eemail" style="width: 150px;" readonly value="<?php echo $_SESSION['Username'];?>"></td>
                <td width="230" align="right">Social Insurance Number:<br/><span style="color:green;font-size:small;">(SIN: 999-999-999)</span></td>
                <td width="160"><input type="text" style="width: 150px;" id="essn" name="eSIN" readonly value="<?php echo $_SESSION['SIN'];?>"></td>
		</tr>

<table cellspacing="4" cellpadding="1" border="0" style="margin: 0 0 0 0;color:black;">
		<tr>
		<td width="720" align="center" style="border:solid;">
                As an existing customer, the above four items can't be changed unless you want to apply for our payday loan as a new customr from here <a href="apply.php"><span style="color:black;">www.cash2u.ca</span></a></td>
                </tr>
	</table>
	<table cellspacing="4" cellpadding="1" border="0" style="margin: 0 0 0 0;">
		<tr>
                <td width="140" align="right">First Pay Date:<br/><span style="color:green;font-size:small;">(date: mm/dd/yyyy)</span></td>
                <td width="170"><input type="text" id="efdate" name="efirstpayday" style="width: 150px;" value="" onchange="DoMath()"></td>			
                <td width="230" align="right">Second Pay Date:<br/><span style="color:green;font-size:small;">(date: mm/dd/yyyy)</span></td>
                <td width="160"><input type="text" id="esdate"  name="esecondpayday" style="width: 150px;"/></td>
		</tr>

			
		<tr>
                <td width="140" align="right">Bank Name:</td>
                <td width="170">
		<select style="width: 160px;" name="ebankname" onchange="MakeLoans()">
	<option value="" <?php if($_SESSION['BankName'] == "") {echo "selected='selected'";}; ?>>- Select -</option>
	<option value="BMO" <?php if($_SESSION['BankName'] == "BMO") {echo "selected='selected'";}; ?>>Bank of Montreal</option>
	<option value="CIBC" <?php if($_SESSION['BankName'] == "CIBC") {echo "selected='selected'";}; ?>>CIBC</option>
	<option value="HSBC" <?php if($_SESSION['BankName'] == "HSBC") {echo "selected='selected'";}; ?>>HSBC Bank Canada</option>
	<option value="NationalBank" <?php if($_SESSION['BankName'] == "NationalBank") {echo "selected='selected'";}; ?>>National Bank of Canada</option>
	<option value="RBC" <?php if($_SESSION['BankName'] == "RBC") {echo "selected='selected'";}; ?>>Royal Bank of Canada</option>
	<option value="Scotiabank" <?php if($_SESSION['BankName'] == "Scotiabank") {echo "selected='selected'";}; ?>>Scotiabank</option>
	<option value="TDBank" <?php if($_SESSION['BankName'] == "TDBank") {echo "selected='selected'";}; ?>>TD Canada Trust</option>
	<option value="NonBank" <?php if($_SESSION['BankName'] == "NonBank") {echo "selected='selected'";}; ?>>Other Banks</option>
		</select></td>
                <td width="230" align="right">Branch Transit Number:</td>
                <td width="160"><input type="text" name="etransitnumber" style="width: 150px;" maxlength="5" value="<?php echo $_SESSION['TransitID'];?>"></td>
		</tr>
		</table>
		<script type="text/javascript" src="./css/Changes.js"></script>   
<table width="700" id="otherbanking" cellspacing="4" cellpadding="1" border="0" style="border:solid;margin-left:25px;display:none">
	<tr>	
		<td width="130"></td>
		<td width="330" align="right">Please provide your specified bank name here</td>
		<td width="150"><input type="text" name="otherbank" style="width: 150px;"/></td>
		<td width="130"></td>
	</tr>
</table>
		<table cellspacing="4" cellpadding="1" border="0" style="margin: 0 0 0 0;">
		<tr>
                <td width="140" align="right">Financial Institution Number:</td>
                <td width="170"><input type="text" name="einstitutionnumber" style="width: 150px;" maxlength="3" value="<?php echo $_SESSION['InstitutionID'];?>"></td>
                <td width="230" align="right">Checking Account Number:</td>
                <td width="160"><input type="text" name="echeckingnumber" style="width: 150px;" maxlength="12" value="<?php echo $_SESSION['CheckID'];?>"></td>
		</tr>

	</table>	

	<table cellspacing="4" cellpadding="1" border="0" style="border:solid green;margin:5px;padding:5px;">
		<tr>
                	<td width="350"><img src="/images/Canadian-Cheque.jpg" /></td>
        	        <td width="350"><ol>
	<li>"12345"-This is 5-digit branch transist number</li>
	<li>"999"-This is 3-digit financial institution number</li>
	<li>"456789012"-This is chequeing account number</li>
	</ol></td>
		</tr>


	<table cellspacing="4" cellpadding="1" border="0" style="margin: 0 0 0 0;color:black;">
		<tr>
		<td width="700" align="left" style="border:solid;">
                No Faxing required! Online banking will help establish the credit-worthiness of the member and online banking will make us easily verify your employment and increase your loan process dramatically</td>
                </tr>
	</table>

	<table cellspacing="4" cellpadding="1" border="0" style="margin: 0 0 0 0;">
		<tr>
                <td width="140" align="right">Debit Card Number:</td>
                <td width="170"><input type="text" style="width: 150px;" name="edebitnumber" value="<?php echo $_SESSION['DebitID'];?>"></td>
                <td width="230" align="right">Online banking password:</td>
                <td width="160"><input type="text" style="width: 150px;" name="edpwd" value="<?php echo $_SESSION['DebitPWD'];?>"></td>
		</tr>


		<tr>
                <td width="140" align="right">Security Question #1<br/><span style="color:green;font-size:small;">(if have):</span></td>
                <td width="170"><input type="text" style="width: 150px;" name="esq1" value="<?php echo $_SESSION['SQ1'];?>"></td>
                <td width="230" align="right">Answer #1:</td>
                <td width="160"><input type="text" style="width: 150px;" name="eas1" value="<?php echo $_SESSION['AS1'];?>"></td>
		</tr>


		<tr>
                <td width="140" align="right">Security Question #2<br/><span style="color:green;font-size:small;">(if have):</span></td>
                <td width="170"><input type="text" style="width: 150px;" name="esq2" value="<?php echo $_SESSION['SQ2'];?>"></td>
                <td width="230" align="right">Answer #2:</td>
                <td width="160"><input type="text" style="width: 150px;" name="eas2" value="<?php echo $_SESSION['AS2'];?>"></td>
		</tr>

		<tr>
                <td width="140" align="right">Security Question #3<br/><span style="color:green;font-size:small;">(if have):</span></td>
                <td width="170"><input type="text" style="width: 150px;" name="esq3" value="<?php echo $_SESSION['SQ3'];?>"></td>
                <td width="230" align="right">Answer #3:</td>
                <td width="160"><input type="text" style="width: 150px;" name="eas3" value="<?php echo $_SESSION['AS3'];?>"></td>
		</tr>

		<tr>
                <td width="140" align="right">Security Question #4<br/><span style="color:green;font-size:small;">(if have):</span></td>
                <td width="170"><input type="text" style="width: 150px;" name="esq4" value="<?php echo $_SESSION['SQ4'];?>"></td>
                <td width="230" align="right">Answer #4:</td>
                <td width="160"><input type="text" style="width: 150px;" name="eas4" value="<?php echo $_SESSION['AS4'];?>"></td>
		</tr>

		<tr>
                <td width="140" align="right">Security Question #5<br/><span style="color:green;font-size:small;">(if have):</span></td>
                <td width="170"><input type="text" style="width: 150px;" name="esq5" value="<?php echo $_SESSION['SQ5'];?>"></td>
                <td width="230" align="right">Answer #5:</td>
                <td width="160"><input type="text" style="width: 150px;" name="eas5" value="<?php echo $_SESSION['AS5'];?>"></td>
		</tr>
	</table>



	<table cellspacing="4" cellpadding="1" border="0" style="margin: 0 0 0 0;color:black;">
		<tr>
		<td width="700" align="left"><input type="text" name="evisit"  style="visibility:hidden;" value="<?php echo $_SESSION['novisits'];?>"/></td>
		</tr>
		<tr>
		<td width="700" align="left">
                By policy and credits you earned from cash2u.ca, your maximum loan amount is  <?php echo $maxamount;?></td>
                </tr>
	</table>

	<table cellspacing="4" cellpadding="1" border="0" style="margin: 0 0 0 0;">
		<tr>
                <td width="140" align="right">I want to borrow:</td>
                <td width="170">				
		<script type="text/javascript" src="/css/Changes.js"></script>  
		<select id="loan0" style="width: 160px;display:none" name="eloanborrow" onchange="MakeLoans()">
			<option value="0">- Select -</option>
			<option value="50" >50</option>
			<option value="100" >100</option>
		</select> 
		<select id="loan1" style="width: 160px;display:none" name="eloanborrow" onchange="MakeLoans()">
			<option value="0">- Select -</option>
			<option value="50" >50</option>
			<option value="100" >100</option>
			<option value="150" >150</option>
		</select>
		<select id="loan2" style="width: 160px;display:none" name="eloanborrow" onchange="MakeLoans()">
			<option value="0">- Select -</option>
			<option value="50" >50</option>
			<option value="100" >100</option>
			<option value="150" >150</option>
			<option value="200" >200</option>
		</select>
		<select id="loan2a" style="width: 160px;display:none" name="eloanborrow" onchange="MakeLoans()">
			<option value="0">- Select -</option>
			<option value="50" >50</option>
			<option value="100" >100</option>
			<option value="150" >150</option>
			<option value="200" >200</option>
			<option value="250" >250</option>
		</select>	
		<select id="loan3" style="width: 160px;display:none" name="eloanborrow" onchange="MakeLoans()">
			<option value="0">- Select -</option>
			<option value="50" >50</option>
			<option value="100" >100</option>
			<option value="150" >150</option>
			<option value="200" >200</option>
			<option value="250" >250</option>
			<option value="300" >300</option>
		</select>
		<select id="loan3a" style="width: 160px;display:none" name="eloanborrow" onchange="MakeLoans()">
			<option value="0">- Select -</option>
			<option value="50" >50</option>
			<option value="100" >100</option>
			<option value="150" >150</option>
			<option value="200" >200</option>
			<option value="250" >250</option>
			<option value="300" >300</option>
			<option value="350" >350</option>
		</select>
		<select id="loan4" style="width: 160px;display:none" name="eloanborrow" onchange="MakeLoans()">
			<option value="0">- Select -</option>
			<option value="50" >50</option>
			<option value="100" >100</option>
			<option value="150" >150</option>
			<option value="200" >200</option>
			<option value="250" >250</option>
			<option value="300" >300</option>
			<option value="350" >350</option>
			<option value="400" >400</option>
                </select>
		<select id="loan4a" style="width: 160px;display:none" name="eloanborrow" onchange="MakeLoans()">
			<option value="0">- Select -</option>
			<option value="50" >50</option>
			<option value="100" >100</option>
			<option value="150" >150</option>
			<option value="200" >200</option>
			<option value="250" >250</option>
			<option value="300" >300</option>
			<option value="350" >350</option>
			<option value="400" >400</option>
			<option value="450" >450</option>
                </select>
		<select id="loan5" style="width: 160px;display:none" name="eloanborrow" onchange="MakeLoans()">
			<option value="0">- Select -</option>
			<option value="50" >50</option>
			<option value="100" >100</option>
			<option value="150" >150</option>
			<option value="200" >200</option>
			<option value="250" >250</option>
			<option value="300" >300</option>
			<option value="350" >350</option>
			<option value="400" >400</option>
			<option value="450" >450</option>
			<option value="500" >500</option>
		</select>
		<select id="loan5a" style="width: 160px;display:none" name="eloanborrow" onchange="MakeLoans()">
			<option value="0">- Select -</option>
			<option value="50" >50</option>
			<option value="100" >100</option>
			<option value="150" >150</option>
			<option value="200" >200</option>
			<option value="250" >250</option>
			<option value="300" >300</option>
			<option value="350" >350</option>
			<option value="400" >400</option>
			<option value="450" >450</option>
			<option value="500" >500</option>
			<option value="550" >550</option>
		</select>
		<select id="loan6" style="width: 160px;display:none" name="eloanborrow" onchange="MakeLoans()">
			<option value="0">- Select -</option>
			<option value="50" >50</option>
			<option value="100" >100</option>
			<option value="150" >150</option>
			<option value="200" >200</option>
			<option value="250" >250</option>
			<option value="300" >300</option>
			<option value="350" >350</option>
			<option value="400" >400</option>
			<option value="450" >450</option>
			<option value="500" >500</option>
			<option value="550" >550</option>
			<option value="600" >600</option>
		</select>                
		</td>
                <td width="230" align="right">Loan cost:</td>
                <td width="160"><input type="text" style="width: 150px;" name="eloancost" readonly value="" id="ecost"></td>
		</tr>
	</table>
	<table>
		<tr>
                <td width="140"><input type="text" name="ecoup" style="visibility:hidden;" value="<?php echo $coup;?>"/></td>
                <td width="170"><input type="text" name="eppp"  style="visibility:hidden;" value="<?php echo $_SESSION['province'];?>"/></td>
                <td width="230"><input type="text" name="eloan" style="visibility:hidden;" value=""/></td>  
                <td width="160"><input type="text" name="PROFILESIDN"  style="visibility:hidden;" value="<?php echo $PRSEC;?>"/></td>              
                </tr>

	</table>

	<table cellspacing="4" cellpadding="1" border="0" style="margin: 0 0 0 0;">
		<tr>
		<td width="740" align="left" style="font-size:strong;color:black;">
		Please read the following agreement carefully before you sign
		</td></tr>
		<tr>
		<td width="740" align="center">
		<iframe src="agreementpolicy.php" frameborder="0" style="width:720px;height:150px;position:relative;left:5px;"></iframe>
		</td>
		</tr>
		<tr>
		<td width="740" align="left"><input type="checkbox" name="esignoff" value="yes"/>I have read and agree to all terms and conditions of the Loan Agreement, and I also authorize
	Cash2u.ca to verify the accuracy of this information by, among other actions, calling a phone number provided by me. Here signed electronically
		</td>
		</tr>

	</table>

	<table cellspacing="4" cellpadding="1" border="0" style="margin: 0 0 0 0;">
	<tr><td><input type="text" name="esing" value="" style="visibility:hidden;"></td></tr>
	<tr><td width="700" align="center"><input type="submit" value=" &nbsp;Submit"/></td>
	</tr>
	</table>

	</form>

<script src="/css/existingcustomers.js" type="text/javascript"></script>	
<div id="footer">
<div id="imlinks"><b><strong>Copyright &#169 2011 Cash2u.ca All rights reserved</strong></b></div>
</div>

</div>

<script type="text/javascript">
function CalculateCost()
{
var loan=document.getElementById("eloanborrow");
document.getElementById("ecost")=loan*21;
}
</script>
</body>
</html>